<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title>数据查询</title>
    <link rel="stylesheet" href="../../layui/css/layui.css">
</head>

<body>
    <form class="layui-form" action="">

        <div class="layui-form" lay-filter="">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>数据查询</legend>
            </fieldset>
            <input type="text" id="keys" style="display: none;">
            <input type="text" id="curvetype" style="display: none;">
            <div id="depth" style="display: none;">
                <div class="layui-form-item">
                    <label class="layui-form-label">开始深度：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="begindepth" autocomplete="off" placeholder="请输入值" class="layui-input"
                            onKeyUp="this.value=this.value.replace(/[^\.\d]/g,'');this.value=this.value.replace('.','');"
                            style="width:160px">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">结束深度：</label>
                    <div class="layui-input-inline">
                        <input type="text" id="enddepth" autocomplete="off" placeholder="请输入值" class="layui-input"
                            onKeyUp="this.value=this.value.replace(/[^\.\d]/g,'');this.value=this.value.replace('.','');"
                            style="width:160px">
                    </div>
                </div>
            </div>
            <div id="time" style="display: none;">
                <div class="layui-form-item">
                    <label class="layui-form-label">开始时间：</label>
                    <div class="layui-input-inline">
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="begintime" placeholder="yyyy-MM-dd HH:mm:ss"
                                style="width:160px">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">结束时间：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="endtime" placeholder="yyyy-MM-dd HH:mm:ss"
                            style="width:160px">
                    </div>
                </div>
            </div>
        </div>

    </form>
    <script type="text/javascript" src="../../jquery-3.0.0.min.js"></script>
    <script type="text/javascript" src="../../layui/layui.js"></script>
    <script type="text/javascript" src="../../layui/public.js"></script>
    <script type="text/javascript" src="../../index.js"></script>
    <script type='text/javascript'>
        var $;
        var form;
        var colorpicker;
        var dataslist;
        layui.use(['form', 'laydate'], function () {
            $ = layui.$;
            form = layui.form;
            laydate = layui.laydate;

            //日期时间选择器
            laydate.render({
                elem: '#begintime'
                , type: 'datetime'
            });

            //日期时间选择器
            laydate.render({
                elem: '#endtime'
                , type: 'datetime'
            });

        });

        function CurveData(datas) {
            dataslist = datas;
            $("#keys").val(datas[0].keys);
            $("#curvetype").val(datas[0].curvetype);
            if (datas[0].curvetype == "1") {
                $("#time").css({ "display": "none" });
                $("#depth").css({ "display": "block" });
            } else {
                $("#time").css({ "display": "block" });
                $("#depth").css({ "display": "none" });
            }
            $("#curvename").empty();
            $("#curvename").append("<option value=''>请选择</option>")
            for (let i = 0; i < datas.length; i++) {
                $("#curvename").append("<option value=" + datas[i].curvename + ">" + datas[i].curvename + "</option>");
            }
            form.render();
        }
    </script>

</body>

</html>